module.exports = app => {
  const { STRING, INTEGER, DATE, Sequelize } = app.Sequelize;
  return app.model.define(
    'call_history',
    {
      history_id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      account_id: { type: INTEGER },
      stu_id: { type:INTEGER },
      stu_name: { type: STRING, allowNull: true },
      class_name: { type: STRING, allowNull: true },
      is_absent: { type: INTEGER, defaultValue: 0 },
      create_time: {
        type: DATE,
        defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
      },
      update_time: {
        type: DATE,
        defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
      },
    },
    {
      freezeTableName: true,
      timestamps: false,
      underscored: true,
    },
  );
};
